import axios from '@/plugins/axios'
export default {
  // 添加计算型标签分组
  addDerivedGroup(params) {
    return axios({
      url: axios.setUrl('ast/astTagDerivedGroup'),
      method: 'post',
      data: axios.setData(params)
    })
  },
  // 更新计算型标签分组
  updateDerivedGroup(params) {
    return axios({
      url: axios.setUrl('ast/astTagDerivedGroup'),
      method: 'put',
      data: axios.setData(params)
    })
  },
  // 拷贝某个客群到某个组下
  copyDerivedGroup(params) {
    return axios({
      url: axios.setUrl('ast/astTagDerivedGroup/copyDerivedToGroup'),
      method: 'post',
      data: axios.setData(params)
    })
  },
  // 获取我的所有分组
  getAllGroup(params) {
    return axios({
      url: axios.setUrl('ast/astTagDerivedGroup/getAllGroup/1'),
      method: 'get',
      params: axios.setParams(params)
    })
  },
  // 分页获取某个分组的客群画像
  getDerivesPage(params) {
    return axios({
      url: axios.setUrl('ast/astTagDerivedGroup/getDerivesPage'),
      method: 'get',
      params: axios.setParams(params)
    })
  },
  // 移动某个客群到某个组下
  transferDerivedToGroup(params) {
    return axios({
      url: axios.setUrl('ast/astTagDerivedGroup/transferDerivedToGroup'),
      method: 'post',
      data: axios.setData(params)
    })
  },
  // 通过id删除计算型标签分组
  deleteDerivedGroup(params) {
    return axios({
      url: axios.setUrl(`ast/astTagDerivedGroup/${params.id}`),
      method: 'delete',
      params: axios.setParams({ groupId: params.id })
    })
  },
  // 分页获取全部客群
  getAllDerivesPage(params) {
    return axios({
      url: axios.setUrl('ast/astTagDerivedGroup/getAllDerivesByPage'),
      method: 'get',
      params: axios.setParams(params)
    })
  },
  // 发布我的客群
  releaseDerived(params) {
    return axios({
      url: axios.setUrl('ast/astTagDerivedGroup/releaseDerived'),
      method: 'post',
      params: axios.setParams(params)
    })
  },
  // 我的客群搜索客群
  searchMyDerived(params) {
    return axios({
      url: axios.setUrl('ast/astTagDerivedGroup/searchMyDerived'),
      method: 'get',
      params: axios.setParams(params, true, '1')
    })
  },
  // 分页查询画像模板
  getImagePage(params) {
    return axios({
      url: axios.setUrl('ast/astTagImageTmpl/page'),
      method: 'get',
      params: axios.setParams(params)
    })
  }
}
